package cn.xumaoyang.org.service.impl;

import cn.xumaoyang.basic.service.impl.BaseServiceImpl;
import cn.xumaoyang.org.domain.Department;
import cn.xumaoyang.org.mapper.DepartmentMapper;
import cn.xumaoyang.org.service.IDepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
//查询的事务，只是看而不操作数据库的，在类上作用于全局。但是操作数据库的数据得单独注解。
@Transactional(readOnly = true , propagation = Propagation.SUPPORTS)
public class DepartmentServiceImpl extends BaseServiceImpl<Department> implements IDepartmentService {



    //没有在抽取得Base得代码得自己写

   @Autowired
   private DepartmentMapper departmentMapper;


    //部门树查询。
    @Override
    public List<Department> queryTree() {
        return departmentMapper.queryTree();
    }
}
